package patrol.mobile.com.mobilepatrol.activity.security.adapter;

import android.content.Context;
import android.content.Intent;
import android.view.View;

import com.dl7.recycler.adapter.BaseQuickAdapter;
import com.dl7.recycler.adapter.BaseViewHolder;

import patrol.mobile.com.mobilepatrol.R;
import patrol.mobile.com.mobilepatrol.activity.security.emergency.EmergencyCheck2Activity;
import patrol.mobile.com.mobilepatrol.bean.CheckListBean;

/**
 * Created by K on 2018/9/11.
 * des:
 */
public class EmergencyCheck1ListAdapter extends BaseQuickAdapter<CheckListBean> {
    public EmergencyCheck1ListAdapter(Context context) {
        super(context);
    }

    @Override
    protected int attachLayoutRes() {
        return R.layout.item_emergency_check1_list;
    }

    @Override
    protected void convert(BaseViewHolder holder, final CheckListBean item) {
        holder.setText(R.id.tv_num, (holder.getLayoutPosition() + 1) + "");
        holder.setText(R.id.tv_orgName, item.getOrgName());
        holder.setText(R.id.tv_checkType, item.getCheckType());
        holder.setText(R.id.tv_checkCategory, item.getCheckCategory());
        holder.setText(R.id.tv_totalScore, "总分" + item.getTotalScore() + "分");
        holder.setText(R.id.tv_realScore, "得分" + item.getRealScore() + "分");
        holder.getView(R.id.rl_root).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(mContext, EmergencyCheck2Activity.class);
                intent.putExtra("id", item.getId());
                mContext.startActivity(intent);
            }
        });
    }
}
